package main

import (
	"fmt"
	"reflect"
)

type resume struct {
	//变量说明
	Name string `info:"name" doc:"我的名字"`
	SEX  string `info:"sex"`
}

func FindTag(str interface{}) {
	t := reflect.TypeOf(str).Elem()
	//v:=reflect.ValueOf(str)
	for i := 0; i < t.NumField(); i++ {
		tagStr := t.Field(i).Tag.Get("info")
		fmt.Println("info: ", tagStr)
	}
}
func goStructTag() {
	var r resume = resume{
		Name: "张三",
		SEX:  "男",
	}
	FindTag(&r)
}
